<template>
  <van-picker
    show-toolbar
    :columns="columns"
    @confirm="onConfirm"
    @cancel="onCancel"
    ref="picker"
  />
</template>

<script>
export default {
  name: 'mydialog',
  components: {},
  props: {
    columns: {
      type: Array,
      required: true
    }
  },
  data() {
    return {}
  },
  computed: {},
  watch: {},
  created() {},
  methods: {
    // 完成事件
    onConfirm() {
      const val = this.$refs.picker.getValues()
      this.$emit('SetValue', val[0])
    },

    // 取消事件
    onCancel() {
      this.$emit('setDia')
    }
  }
}
</script>

<style scoped lang="less">
:deep(.van-picker__confirm) {
  color: #108ee9;
  font-size: 34px;
}
:deep(.van-picker__cancel) {
  color: #108ee9;
  font-size: 34px;
}
</style>
